﻿namespace ItemsAnimation
{
	public class BusinessObject
	{
		public BusinessObject()
		{
			Id = id;
			id++;
		}

		public string FirstName { get; set; }

		public string LastName { get; set; }

		public string ImagePath { get; set; }

		public int Id { get; private set; }

		private static int id = 1;

		public override string ToString()
		{
			return string.Format("{0} {1}", FirstName, LastName);
		}

		public override bool Equals(object obj)
		{
			var that = obj as BusinessObject;
			if (that == null)
			{
				return false;
			}

			return that.FirstName == FirstName && that.LastName == LastName && that.Id == id;
		}

		public override int GetHashCode()
		{
			return string.Format("{0}:{1}:{2}", Id, FirstName, LastName).GetHashCode();
		}
	}
}